﻿<%@ Page Language="C#" MasterPageFile="~/web.master" AutoEventWireup="true" CodeBehind="branch_nip_so_add.aspx.cs"
    Inherits="Shuba.Web.master.branch_nip_so_add" %>

<%@ Register Assembly="Shuba.Framework" Namespace="Shuba.Framework" TagPrefix="cc" %>
<asp:Content ID="Header1" ContentPlaceHolderID="HeaderPlaceHolder" runat="server">

    <script language="javascript">
        function Validate() {
            if (document.getElementById('<%= chkIsMigration.ClientID %>').checked == true) {
                return confirm('Are you sure, you want to Migrate this user ?\nMac Address will be automatic change after SO login at new PC');
            }
        }

        function ValMigration() {
            if (document.getElementById('ctl00_ContentPlaceHolder1_chkIsMigration').checked && document.getElementById('ctl00_ContentPlaceHolder1_ddlUserType').value == 'SO') {
                if (confirm('Are you sure, you want to Migration this user ?\nMac Address will be automatic change after SO login at new PC')) {
                    document.getElementById('ctl00_ContentPlaceHolder1_txtMACAddress').value = document.getElementById('ctl00_ContentPlaceHolder1_hidOldMACAddress').value;
                    document.getElementById('ctl00_ContentPlaceHolder1_txtMACAddress').disabled = true;
                }
                else {
                    document.getElementById('ctl00_ContentPlaceHolder1_chkIsMigration').checked = false;
                }
            }
            else {
                document.getElementById('ctl00_ContentPlaceHolder1_txtMACAddress').disabled = false;
            }
        }

    </script>

</asp:Content>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <table class="text" border="0" width="100%" cellspacing="0" cellpadding="2">
        <tr>
            <td class="text bg_content" bgcolor="#FFFFFF" align="center">
                <p>
                    &nbsp;</p>
                <table class="black" border="0" width="95%" cellspacing="0" cellpadding="0">
                    <tr>
                        <td class="title_back" align="left">
                            <table class="text" border="0" width="100%" cellspacing="0" cellpadding="0">
                                <tr>
                                    <td class="title_back2" width="2%">
                                        &nbsp;
                                    </td>
                                    <td class="title_back2 title_white" width="30%">
                                        <asp:Label ID="LabelTitle" runat="server" Text="Label"></asp:Label>
                                    </td>
                                    <td>
                                        <span class="title_right"></span>
                                    </td>
                                </tr>
                            </table>
                        </td>
                        <td class="title_back" align="right">
                            <a class="text" href="branch_nip_so_list.aspx">User Mapping List</a>&nbsp;&nbsp;
                            <a class="text" href="branch_nip_so_upload.aspx">Upload Data</a>&nbsp;&nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2" class="border_nobottom bg_subtitle_white">
                            &nbsp; Insert / Update
                        </td>
                    </tr>
                    <tr>
                        <td class="border_nobottom" colspan="2">
                            <asp:UpdatePanel runat="server" ID="up">
                                <ContentTemplate>
                                    <table class="text" border="0" width="100%" cellspacing="0" cellpadding="2">
                                        <tr>
                                            <td class="bg_grid" align="right" width="30%">
                                                Application Type</td>
                                            <td class="bg_grid2" width="70%" align="left">
                                                <asp:DropDownList ID="ddlAppType" runat="server" Width="30%" CssClass="text" AutoPostBack="True"
                                                    OnSelectedIndexChanged="ddlAppType_SelectedIndexChanged">
                                                    <asp:ListItem Value="10">Biasa</asp:ListItem>
                                                    <asp:ListItem Value="64">Hub Spoke</asp:ListItem>
                                                </asp:DropDownList>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td align="right" class="bg_grid" width="30%">User Type </td>
                                            <td align="left" class="bg_grid2" width="70%">
                                                <asp:HiddenField ID="hidID" runat="server" />
                                                <asp:HiddenField ID="hidOldMACAddress" runat="server" />
                                                <asp:DropDownList ID="ddlUserType" runat="server" AutoPostBack="True" CssClass="text" OnSelectedIndexChanged="ddlUserType_SelectedIndexChanged" Width="30%">
                                                </asp:DropDownList>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="bg_grid" align="right" width="25%">
                                                Cost Center
                                            </td>
                                            <td class="bg_grid2" align="left">
                                                <asp:TextBox ID="txtBranchCode" runat="server" Width="100px" MaxLength="5" CssClass="text"></asp:TextBox>
                                                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtBranchCode"
                                                    ErrorMessage="&nbsp;Cost Center is Required"></asp:RequiredFieldValidator>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="bg_grid" align="right" width="25%">
                                                AO Code
                                            </td>
                                            <td class="bg_grid2" align="left">
                                                <asp:TextBox ID="txtAOCode" runat="server" Width="100px" MaxLength="5" CssClass="text"></asp:TextBox>
                                                <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtAOCode"
                                                    ErrorMessage="&nbsp;AO Code is Required"></asp:RequiredFieldValidator>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="bg_grid" align="right" width="25%">
                                                NIP
                                            </td>
                                            <td class="bg_grid2" align="left">
                                                <asp:TextBox ID="txtNIP" runat="server" Width="100px" MaxLength="9" CssClass="text"></asp:TextBox>
                                                <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="txtNIP"
                                                    ErrorMessage="&nbsp;NIP is Required"></asp:RequiredFieldValidator>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="bg_grid" align="right" width="30%">
                                                Mobile Phone
                                            </td>
                                            <td class="bg_grid2" width="70%" align="left">
                                                <asp:TextBox ID="txtHP" CssClass="text" Width="30%" MaxLength="18" runat="server"></asp:TextBox>
                                                <asp:RegularExpressionValidator ID="RegVal1" ControlToValidate="txtHP" runat="server"
                                                    ErrorMessage="&nbsp;Invalid Entry, Phone Number Must be 0-9 or space"></asp:RegularExpressionValidator>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="bg_grid" align="right" width="30%">
                                                MAC Address
                                            </td>
                                            <td class="bg_grid2" width="70%" align="left">
                                                <asp:TextBox ID="txtMACAddress" CssClass="text" Width="30%" MaxLength="50" runat="server"></asp:TextBox>&nbsp;<asp:Label
                                                    ID="lblMac" runat="server" ForeColor="Red" Text="Fill this for manual migration Sales Officer"></asp:Label>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="bg_grid" align="right" width="30%">
                                                Is Migration
                                            </td>
                                            <td class="bg_grid2" width="70%" align="left">
                                                <asp:CheckBox ID="chkIsMigration" onclick="ValMigration()" runat="server" /></asp:CheckBox>&nbsp;<asp:Label
                                                    ID="lblMigration" runat="server" ForeColor="Red" Text="Check this for auto migration Sales Officer"></asp:Label>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="bg_grid" align="right">
                                                AO Capability
                                            </td>
                                            <td class="bg_grid2" align="left">
                                                <asp:DropDownList ID="ddlAOType" CssClass="text" Width="31%" runat="server" Height="16px">
                                                    <asp:ListItem>- Pilih dengan tepat dan benar -</asp:ListItem>
                                                    <asp:ListItem Text="AO Funding" Value="F"></asp:ListItem>
                                                    <asp:ListItem Text="AO Lending" Value="L"></asp:ListItem>
                                                    <asp:ListItem Text="AO Funding & Lending" Value="FL"></asp:ListItem>
                                                </asp:DropDownList>
                                            </td>
                                        </tr>
                                    </table>
                                </ContentTemplate>
                            </asp:UpdatePanel>
                            <!-- Error Message -->
                            <table runat="server" visible="false" id="ErrBox" class="border" border="0" width="100%"
                                cellspacing="0" cellpadding="2">
                                <tr>
                                    <td class="bg_grid2" align="center">
                                        <asp:Label ID="ErrMsg" runat="server" Text="" Font-Bold="true" ForeColor="Red"></asp:Label>
                                    </td>
                                </tr>
                            </table>
                            <!-- End Of Error Message -->
                        </td>
                    </tr>
                    <tr>
                        <td class="border bg_footer" colspan="2" align="right">
                            <asp:Button ID="btnSubmit" runat="server" Text="Submit" CssClass="buttonsmall" OnClick="btnSubmit_Click" />
                            <%--OnClientClick="return Validate();"--%>
                            <asp:Button ID="btnCancel" runat="server" Text="Cancel" CssClass="buttonsmall" CausesValidation="False"
                                OnClick="btnCancel_Click" />
                            &nbsp; &nbsp;
                        </td>
                    </tr>
                </table>
                <p>
            </td>
        </tr>
    </table>
</asp:Content>
